<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>ServoCtrl: src/lpc_types.h Source File</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />

<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">ServoCtrl
   
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.8.0 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>Globals</span></a></li>
    </ul>
  </div>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">src/lpc_types.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="lpc__types_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/**********************************************************************</span>
<a name="l00002"></a>00002 <span class="comment">* $Id$          lpc_types.h             2008-07-27</span>
<a name="l00003"></a>00003 <span class="comment">*/</span>
<a name="l00029"></a>00029 <span class="comment">/* Type group ----------------------------------------------------------- */</span>
<a name="l00035"></a>00035 <span class="preprocessor">#ifndef LPC_TYPES_H</span>
<a name="l00036"></a>00036 <span class="preprocessor"></span><span class="preprocessor">#define LPC_TYPES_H</span>
<a name="l00037"></a>00037 <span class="preprocessor"></span>
<a name="l00038"></a>00038 <span class="comment">/* Includes ------------------------------------------------------------------- */</span>
<a name="l00039"></a>00039 <span class="preprocessor">#include &lt;stdint.h&gt;</span>
<a name="l00040"></a>00040 
<a name="l00041"></a>00041 
<a name="l00042"></a>00042 <span class="comment">/* Public Types --------------------------------------------------------------- */</span>
<a name="l00050"></a><a class="code" href="group___l_p_c___types___public___types.html#ga39db6982619d623273fad8a383489309">00050</a> <span class="keyword">typedef</span> <span class="keyword">enum</span> {FALSE = 0, TRUE = !FALSE} <a class="code" href="group___l_p_c___types___public___types.html#ga39db6982619d623273fad8a383489309" title="Boolean Type definition.">Bool</a>;
<a name="l00051"></a>00051 
<a name="l00055"></a><a class="code" href="group___l_p_c___types___public___types.html#ga89136caac2e14c55151f527ac02daaff">00055</a> <span class="keyword">typedef</span> <span class="keyword">enum</span> {RESET = 0, SET = !RESET} <a class="code" href="group___l_p_c___types___public___types.html#ga89136caac2e14c55151f527ac02daaff" title="Flag Status and Interrupt Flag Status type definition.">FlagStatus</a>, IntStatus, SetState;
<a name="l00056"></a>00056 <span class="preprocessor">#define PARAM_SETSTATE(State) ((State==RESET) || (State==SET))</span>
<a name="l00057"></a>00057 <span class="preprocessor"></span>
<a name="l00061"></a><a class="code" href="group___l_p_c___types___public___types.html#gac9a7e9a35d2513ec15c3b537aaa4fba1">00061</a> <span class="keyword">typedef</span> <span class="keyword">enum</span> {DISABLE = 0, ENABLE = !DISABLE} <a class="code" href="group___l_p_c___types___public___types.html#gac9a7e9a35d2513ec15c3b537aaa4fba1" title="Functional State Definition.">FunctionalState</a>;
<a name="l00062"></a>00062 <span class="preprocessor">#define PARAM_FUNCTIONALSTATE(State) ((State==DISABLE) || (State==ENABLE))</span>
<a name="l00063"></a>00063 <span class="preprocessor"></span>
<a name="l00067"></a><a class="code" href="group___l_p_c___types___public___types.html#ga67a0db04d321a74b7e7fcfd3f1a3f70b">00067</a> <span class="keyword">typedef</span> <span class="keyword">enum</span> {ERROR = 0, SUCCESS = !ERROR} <a class="code" href="group___l_p_c___types___public___types.html#ga67a0db04d321a74b7e7fcfd3f1a3f70b">Status</a>;
<a name="l00068"></a>00068 
<a name="l00069"></a>00069 
<a name="l00073"></a><a class="code" href="group___l_p_c___types___public___types.html#gaddb88bff95842be0c54e0e979f45cf95">00073</a> <span class="keyword">typedef</span> <span class="keyword">enum</span>
<a name="l00074"></a>00074 {
<a name="l00075"></a><a class="code" href="group___l_p_c___types___public___types.html#ggaddb88bff95842be0c54e0e979f45cf95ae00130e64382c35d172d226b79aa9acb">00075</a>         <a class="code" href="group___l_p_c___types___public___types.html#ggaddb88bff95842be0c54e0e979f45cf95ae00130e64382c35d172d226b79aa9acb">NONE_BLOCKING</a> = 0,              
<a name="l00076"></a><a class="code" href="group___l_p_c___types___public___types.html#ggaddb88bff95842be0c54e0e979f45cf95a854a1cd6e3a98db9e290dddea29725e7">00076</a>         <a class="code" href="group___l_p_c___types___public___types.html#ggaddb88bff95842be0c54e0e979f45cf95a854a1cd6e3a98db9e290dddea29725e7">BLOCKING</a>                                
<a name="l00077"></a>00077 } <a class="code" href="group___l_p_c___types___public___types.html#gaddb88bff95842be0c54e0e979f45cf95">TRANSFER_BLOCK_Type</a>;
<a name="l00078"></a>00078 
<a name="l00079"></a>00079 
<a name="l00081"></a><a class="code" href="group___l_p_c___types___public___types.html#ga2d6ebcfe3babcb204d017c685825a4d8">00081</a> <span class="keyword">typedef</span> void (*<a class="code" href="group___l_p_c___types___public___types.html#ga2d6ebcfe3babcb204d017c685825a4d8">PFV</a>)();
<a name="l00082"></a>00082 
<a name="l00084"></a><a class="code" href="group___l_p_c___types___public___types.html#ga39628beaa6435daa2ae29ba204c920da">00084</a> <span class="keyword">typedef</span> int32_t(*<a class="code" href="group___l_p_c___types___public___types.html#ga39628beaa6435daa2ae29ba204c920da">PFI</a>)();
<a name="l00085"></a>00085 
<a name="l00091"></a>00091 <span class="comment">/* Public Macros -------------------------------------------------------------- */</span>
<a name="l00096"></a>00096 <span class="comment">/* _BIT(n) sets the bit at position &quot;n&quot;</span>
<a name="l00097"></a>00097 <span class="comment"> * _BIT(n) is intended to be used in &quot;OR&quot; and &quot;AND&quot; expressions:</span>
<a name="l00098"></a>00098 <span class="comment"> * e.g., &quot;(_BIT(3) | _BIT(7))&quot;.</span>
<a name="l00099"></a>00099 <span class="comment"> */</span>
<a name="l00100"></a>00100 <span class="preprocessor">#undef _BIT</span>
<a name="l00101"></a>00101 <span class="preprocessor"></span><span class="comment">/* Set bit macro */</span>
<a name="l00102"></a>00102 <span class="preprocessor">#define _BIT(n) (1&lt;&lt;n)</span>
<a name="l00103"></a>00103 <span class="preprocessor"></span>
<a name="l00104"></a>00104 <span class="comment">/* _SBF(f,v) sets the bit field starting at position &quot;f&quot; to value &quot;v&quot;.</span>
<a name="l00105"></a>00105 <span class="comment"> * _SBF(f,v) is intended to be used in &quot;OR&quot; and &quot;AND&quot; expressions:</span>
<a name="l00106"></a>00106 <span class="comment"> * e.g., &quot;((_SBF(5,7) | _SBF(12,0xF)) &amp; 0xFFFF)&quot;</span>
<a name="l00107"></a>00107 <span class="comment"> */</span>
<a name="l00108"></a>00108 <span class="preprocessor">#undef _SBF</span>
<a name="l00109"></a>00109 <span class="preprocessor"></span><span class="comment">/* Set bit field macro */</span>
<a name="l00110"></a>00110 <span class="preprocessor">#define _SBF(f,v) (v&lt;&lt;f)</span>
<a name="l00111"></a>00111 <span class="preprocessor"></span>
<a name="l00112"></a>00112 <span class="comment">/* _BITMASK constructs a symbol with &#39;field_width&#39; least significant</span>
<a name="l00113"></a>00113 <span class="comment"> * bits set.</span>
<a name="l00114"></a>00114 <span class="comment"> * e.g., _BITMASK(5) constructs &#39;0x1F&#39;, _BITMASK(16) == 0xFFFF</span>
<a name="l00115"></a>00115 <span class="comment"> * The symbol is intended to be used to limit the bit field width</span>
<a name="l00116"></a>00116 <span class="comment"> * thusly:</span>
<a name="l00117"></a>00117 <span class="comment"> * &lt;a_register&gt; = (any_expression) &amp; _BITMASK(x), where 0 &lt; x &lt;= 32.</span>
<a name="l00118"></a>00118 <span class="comment"> * If &quot;any_expression&quot; results in a value that is larger than can be</span>
<a name="l00119"></a>00119 <span class="comment"> * contained in &#39;x&#39; bits, the bits above &#39;x - 1&#39; are masked off.  When</span>
<a name="l00120"></a>00120 <span class="comment"> * used with the _SBF example above, the example would be written:</span>
<a name="l00121"></a>00121 <span class="comment"> * a_reg = ((_SBF(5,7) | _SBF(12,0xF)) &amp; _BITMASK(16))</span>
<a name="l00122"></a>00122 <span class="comment"> * This ensures that the value written to a_reg is no wider than</span>
<a name="l00123"></a>00123 <span class="comment"> * 16 bits, and makes the code easier to read and understand.</span>
<a name="l00124"></a>00124 <span class="comment"> */</span>
<a name="l00125"></a>00125 <span class="preprocessor">#undef _BITMASK</span>
<a name="l00126"></a>00126 <span class="preprocessor"></span><span class="comment">/* Bitmask creation macro */</span>
<a name="l00127"></a>00127 <span class="preprocessor">#define _BITMASK(field_width) ( _BIT(field_width) - 1)</span>
<a name="l00128"></a>00128 <span class="preprocessor"></span>
<a name="l00129"></a>00129 <span class="comment">/* NULL pointer */</span>
<a name="l00130"></a>00130 <span class="preprocessor">#ifndef NULL</span>
<a name="l00131"></a>00131 <span class="preprocessor"></span><span class="preprocessor">#define NULL ((void*) 0)</span>
<a name="l00132"></a>00132 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00133"></a>00133 <span class="preprocessor"></span>
<a name="l00134"></a>00134 <span class="comment">/* Number of elements in an array */</span>
<a name="l00135"></a>00135 <span class="preprocessor">#define NELEMENTS(array)  (sizeof (array) / sizeof (array[0]))</span>
<a name="l00136"></a>00136 <span class="preprocessor"></span>
<a name="l00137"></a>00137 <span class="comment">/* Static data/function define */</span>
<a name="l00138"></a>00138 <span class="preprocessor">#define STATIC static</span>
<a name="l00139"></a>00139 <span class="preprocessor"></span><span class="comment">/* External data/function define */</span>
<a name="l00140"></a>00140 <span class="preprocessor">#define EXTERN extern</span>
<a name="l00141"></a>00141 <span class="preprocessor"></span>
<a name="l00142"></a>00142 <span class="preprocessor">#define MAX(a, b) (((a) &gt; (b)) ? (a) : (b))</span>
<a name="l00143"></a>00143 <span class="preprocessor"></span><span class="preprocessor">#define MIN(a, b) (((a) &lt; (b)) ? (a) : (b))</span>
<a name="l00144"></a>00144 <span class="preprocessor"></span>
<a name="l00150"></a>00150 <span class="comment">/* Old Type Definition compatibility ------------------------------------------ */</span>
<a name="l00156"></a><a class="code" href="group___l_p_c___types___public___types.html#gaebb9e13210d88d43e32e735ada43a425">00156</a> <span class="keyword">typedef</span> <span class="keywordtype">char</span> <a class="code" href="group___l_p_c___types___public___types.html#gaebb9e13210d88d43e32e735ada43a425">CHAR</a>;
<a name="l00157"></a>00157 
<a name="l00159"></a><a class="code" href="group___l_p_c___types___public___types.html#ga7353117656180c64d2216c874998b98b">00159</a> <span class="keyword">typedef</span> uint8_t <a class="code" href="group___l_p_c___types___public___types.html#ga7353117656180c64d2216c874998b98b">UNS_8</a>;
<a name="l00160"></a>00160 
<a name="l00162"></a><a class="code" href="group___l_p_c___types___public___types.html#gac172005ce53b001f50a677cc10bd17b0">00162</a> <span class="keyword">typedef</span> int8_t <a class="code" href="group___l_p_c___types___public___types.html#gac172005ce53b001f50a677cc10bd17b0">INT_8</a>;
<a name="l00163"></a>00163 
<a name="l00165"></a><a class="code" href="group___l_p_c___types___public___types.html#gafce87a7f2271b2cf38d7532f157f8a50">00165</a> <span class="keyword">typedef</span> uint16_t <a class="code" href="group___l_p_c___types___public___types.html#gafce87a7f2271b2cf38d7532f157f8a50">UNS_16</a>;
<a name="l00166"></a>00166 
<a name="l00168"></a><a class="code" href="group___l_p_c___types___public___types.html#gaae6e34a91bf60db05de64de7720df9a5">00168</a> <span class="keyword">typedef</span> int16_t <a class="code" href="group___l_p_c___types___public___types.html#gaae6e34a91bf60db05de64de7720df9a5">INT_16</a>;
<a name="l00169"></a>00169 
<a name="l00171"></a><a class="code" href="group___l_p_c___types___public___types.html#ga28adf5c6b1811ca447826319598d8aba">00171</a> <span class="keyword">typedef</span> uint32_t <a class="code" href="group___l_p_c___types___public___types.html#ga28adf5c6b1811ca447826319598d8aba">UNS_32</a>;
<a name="l00172"></a>00172 
<a name="l00174"></a><a class="code" href="group___l_p_c___types___public___types.html#ga3a17614f3a1b67eaf20781d8ec16a652">00174</a> <span class="keyword">typedef</span> int32_t <a class="code" href="group___l_p_c___types___public___types.html#ga3a17614f3a1b67eaf20781d8ec16a652">INT_32</a>;
<a name="l00175"></a>00175 
<a name="l00177"></a><a class="code" href="group___l_p_c___types___public___types.html#ga1a0aab29eee6b306564084e005fa5750">00177</a> <span class="keyword">typedef</span> int64_t <a class="code" href="group___l_p_c___types___public___types.html#ga1a0aab29eee6b306564084e005fa5750">INT_64</a>;
<a name="l00178"></a>00178 
<a name="l00180"></a><a class="code" href="group___l_p_c___types___public___types.html#ga2299199b92f0535ad8c2e2d8c7c7f09b">00180</a> <span class="keyword">typedef</span> uint64_t <a class="code" href="group___l_p_c___types___public___types.html#ga2299199b92f0535ad8c2e2d8c7c7f09b">UNS_64</a>;
<a name="l00181"></a>00181 
<a name="l00183"></a><a class="code" href="group___l_p_c___types___public___types.html#gae82ce7bbea976c0646ed6458705df2ae">00183</a> <span class="keyword">typedef</span> <a class="code" href="group___l_p_c___types___public___types.html#ga39db6982619d623273fad8a383489309" title="Boolean Type definition.">Bool</a> <a class="code" href="group___l_p_c___types___public___types.html#gae82ce7bbea976c0646ed6458705df2ae">BOOL_32</a>;
<a name="l00184"></a>00184 
<a name="l00186"></a><a class="code" href="group___l_p_c___types___public___types.html#gaa14120a3f1d4674cce6060fe093abde0">00186</a> <span class="keyword">typedef</span> <a class="code" href="group___l_p_c___types___public___types.html#ga39db6982619d623273fad8a383489309" title="Boolean Type definition.">Bool</a> <a class="code" href="group___l_p_c___types___public___types.html#gaa14120a3f1d4674cce6060fe093abde0">BOOL_16</a>;
<a name="l00187"></a>00187 
<a name="l00189"></a><a class="code" href="group___l_p_c___types___public___types.html#gaefbcf737e3e031d1b6522b4cd079a292">00189</a> <span class="keyword">typedef</span> <a class="code" href="group___l_p_c___types___public___types.html#ga39db6982619d623273fad8a383489309" title="Boolean Type definition.">Bool</a> <a class="code" href="group___l_p_c___types___public___types.html#gaefbcf737e3e031d1b6522b4cd079a292">BOOL_8</a>;
<a name="l00190"></a>00190 
<a name="l00196"></a>00196 <span class="preprocessor">#endif </span><span class="comment">/* LPC_TYPES_H */</span>
<a name="l00197"></a>00197 
<a name="l00202"></a>00202 <span class="comment">/* --------------------------------- End Of File ------------------------------ */</span>
</pre></div></div><!-- contents -->


<hr class="footer"/><address class="footer"><small>
Generated on Sat Jul 7 2012 17:48:48 for ServoCtrl by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.0
</small></address>

</body>
</html>
